package com.wangbo.basic.circular;

public class Test {
    public static void main(String[] args) {
        CircularLinkedList<Integer> circularLinkedList = new CircularLinkedList<>();
        for (int i = 1; i < 6; i++) {
            circularLinkedList.add(i);
        }
        /**
         * Node{data=1}
         * Node{data=2}
         * Node{data=3}
         * Node{data=4}
         * Node{data=5}
         **/
        circularLinkedList.show();
        System.out.println();
        /**
         * Node{data=2}
         * Node{data=4}
         * Node{data=1}
         * Node{data=5}
         * Node{data=3}
         **/
        while (!circularLinkedList.isEmpty()) {
            Node<Integer> node = circularLinkedList.remove(2);
            System.out.println(node);
        }
    }
}
